/*
  File: MajorCourseMapEntity.cs
  Author: rcrxy
  CreateTime: 2025/06/26 18:37

  Description:
*/

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace StudentVideo.Data.Entities;

/// <summary>
/// 专业-课程映射
/// </summary>
[Table("major_course_map")]
[Index(nameof(MajorId))]
[Index(nameof(CourseId))]
[PrimaryKey(nameof(MajorId), nameof(CourseId))]
public class MajorCourseMapEntity {

   /// <summary>
   /// 专业id
   /// </summary>
   [MaxLength(50)]
   public required string MajorId { get; set; }

   [ForeignKey(nameof(MajorId))]
   public required MajorEntity Major { get; set; }

   /// <summary>
   /// 课程id
   /// </summary>
   [MaxLength(50)]
   public required string CourseId { get; set; }

   [ForeignKey(nameof(CourseId))]
   public required CourseEntity Course { get; set; }
}
